package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Author: zsh
 * Date: 2023/11/18
 * Describe: 牲畜表与配种表关联表
 */
@DatabaseTable(tableName = "LabelBreed")
public class LabelBreed {

	public final static String LABEL_ID_M_NAME = "label_m_id";
	public final static String LABEL_ID_W_NAME = "label_w_id";
	public final static String BREED_ID_FIELD_NAME = "breed_id";

	@DatabaseField(generatedId = true)
	int id;

	// Label
	@DatabaseField(foreign = true, columnName = LABEL_ID_M_NAME)
	Label label_m;
	// Label
	@DatabaseField(foreign = true, columnName = LABEL_ID_W_NAME)
	Label label_w;

	// Breed
	@DatabaseField(foreign = true, columnName = BREED_ID_FIELD_NAME)
	Breed breed;

	LabelBreed() {
		// for ormlite
	}

	public LabelBreed(Label label_m, Label label_w, Breed breed) {
		this.label_m = label_m;
		this.label_w = label_w;
		this.breed = breed;
	}

	@Override
	public String toString() {
		return "LabelBreed{" +
				"id=" + id +
				", label_m=" + label_m +
				", label_w=" + label_w +
				", breed=" + breed +
				'}';
	}
}
